//2009/09/09 16:13:57
#include <string>
#include <vector>
#include <map>
#include <queue>
#include <sstream>
#include <algorithm>

using namespace std;

class Hangman
{
public:
    string guessWord(string feedback, vector <string> words)
    {
        int cnt = 0;
        string ret;
        for (int i=0; i<words.size(); i++)
        {
            if (feedback.size() == words[i].size())
            {
                bool flag = true;
                for (int j=0; j<feedback.size(); j++)
                    if ((feedback[j] != '-' && feedback[j] != words[i][j]) || (feedback[j]=='-' && feedback.find(words[i][j]) != -1))
                    {
                        flag = false;
                        break;
                    }
                if (flag)
                {
                    ret = words[i];
                    cnt ++;
                }
            }
        }
        return cnt==1?ret:"";
    }
};
